Managing output streams: class ostream

Contents|Index|Previous|Next
Managing output streams: class ostream

Objects of class, ostream, inherit the generic methods from ios, and in addition have the following methods available. Declarations for this class come from iostream.h.

See also the following documentation’s discussion for more information.

- Writing on an ostream
- Repositioning an ostream
- Miscellaneous ostream utilities

ostream::ostream ()
Constructor

The simplest form of the constructor for an ostream simply initializes a new ios object.

ostream::ostream (streambuf* sb [, ostream tie])
Constructor

This alternative constructor requires a first argument, sb, (of type, streambuf*) to use an existing open stream for output. It also accepts an optional second argument, tie, to specify a related ostream* as the initial value for ios::tie.

If you use this constructor, the argument, sb, is not destroyed (or deleted or closed) when the ostream is destroyed.

Top|Contents|Index|Previous|Next